@echo off

set pause=true
if /i "%1"=="/q" (
 set pause=false
 SHIFT
)


RMDIR "..\..\XXX\bin" /Q /S
@if errorlevel 1 goto :error
RMDIR "..\..\XXX\obj" /Q /S
@if errorlevel 1 goto :error

RMDIR "..\..\XXX.UI\bin" /Q /S
@if errorlevel 1 goto :error
RMDIR "..\..\XXX.UI\obj" /Q /S
@if errorlevel 1 goto :error

RMDIR "..\..\XXX.UI.Wpf\bin" /Q /S
@if errorlevel 1 goto :error
RMDIR "..\..\XXX.UI.Wpf\obj" /Q /S
@if errorlevel 1 goto :error


@goto :exit



:error
if %returnErrorCode%==false goto exit

@ECHO An error occured - %errorLevel%
PAUSE
@exit errorLevel



:exit
if %pause%==true PAUSE
